package net.pugsplace.gpremacy.rules;

import java.io.File;
import java.util.ResourceBundle;

import net.pugsplace.gpremacy.packets.Packet;
import net.pugsplace.gpremacy.server.ClientListener;
import net.pugsplace.gpremacy.server.net.Connection;

/** Rule sets are implemented by Python classes */
public class RuleSet implements ClientListener {
	String identifier;
	String description;

	Resource[] resources;
	UnitType[] units;
	Country[] countries;
	Worldmap worldmap;
	Corporation[] corporations;
	Market market;
	long turnLimit;
	WinningCondition[] winningConditions;
	Phase[] phases;
	OrderOfBattle[] orderOfBattles;
	ResourceBundle resourceBundle;
	File[] images;

	public void clientDisconnected(Connection connectionObject) {
		// TODO Auto-generated method stub

	}

	public Corporation[] getCorporations() {
		return corporations.clone();
	}

	public Country[] getCountries() {
		return countries.clone();
	}

	public String getDescription() {
		// Strings are immutable
		return description;
	}

	public String getIdentifier() {
		// Strings are immutable
		return identifier;
	}

	public File[] getImages() {
		return images.clone();
	}

	public Market getMarket() {
		return market.clone();
	}

	public OrderOfBattle[] getOrderOfBattles() {
		return orderOfBattles.clone();
	}

	public Phase[] getPhases() {
		return phases.clone();
	}

	public ResourceBundle getResourceBundle() {
		// TODO: determine whether I need to clone the resource bundle
		return resourceBundle;
	}

	public Resource[] getResources() {
		return resources.clone();
	}

	public long getTurnLimit() {
		return turnLimit;
	}

	public UnitType[] getUnits() {
		return units.clone();
	}

	public WinningCondition[] getWinningConditions() {
		return winningConditions.clone();
	}

	public Worldmap getWorldmap() {
		return worldmap.clone();
	}

	public boolean receivedPacket(Connection connectionObject, Packet packetObject) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public String toString() {
		return identifier;
	}
}
